package _0812;

import java.util.LinkedList;

public class LinkedListDemo {
    public static void main(String[] args) {
        LinkedList<Integer> list = new LinkedList<>();
        list.add(100);
        list.add(200);
        list.addFirst(500);
        list.addLast(300);
        System.out.println("list" + list);

        int first = list.getFirst();
        int last = list.getLast();
        System.out.println("first:" + first + ",last:" + last);

        list.removeFirst();
        System.out.println("list:" + list);
        list.removeLast();
        System.out.println("list:" + list);
    }
}
